﻿using System;

namespace LearnCSharp_1
{
    class LearnString
    {
        static void Main_String(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.ReadKey();

            string aFriend = "Bill";
            Console.WriteLine("Hello " + aFriend);
            Console.ReadKey();

            Console.WriteLine($"Hello {aFriend}");
            Console.ReadKey();

            string firstFriend = "Maria";
            string secondFriend = "Sage";
            Console.WriteLine($"The name {firstFriend} has {firstFriend.Length} letters.");
            Console.WriteLine($"The name {secondFriend} has {secondFriend.Length} letters.");
            Console.ReadKey();

            string greeting = "    Hello world!   ";
            Console.WriteLine($"[{greeting}]");
            string trimmedGreeting = greeting.TrimStart();
            Console.WriteLine($"[{trimmedGreeting}]");
            trimmedGreeting = greeting.TrimEnd();
            Console.WriteLine($"[{trimmedGreeting}]");
            trimmedGreeting = greeting.Trim();
            Console.WriteLine($"[{trimmedGreeting}]");
            Console.ReadKey();

            string sayHello = "Hello World";
            Console.WriteLine(sayHello);
            sayHello = sayHello.Replace("Hello", "Greetings");
            Console.WriteLine(sayHello);
            Console.ReadKey();

            Console.WriteLine(sayHello.ToUpper());
            Console.WriteLine(sayHello.ToLower());
            Console.ReadLine();

            string songLyrics = "You say goodbye, and I say hello";
            Console.WriteLine(songLyrics.Contains("goodbye"));
            Console.WriteLine(songLyrics.Contains("greetings"));
            Console.ReadKey();

            Console.WriteLine(songLyrics.EndsWith("hello"));
            Console.WriteLine(songLyrics.EndsWith("goodbye"));
            Console.ReadKey();


        }
    }
}